//
//  DYSignatureResultCell.m
//  DaYing
//
//  Created by DaYing  on 2023.
//  Copyright © 2023年 DaYing . All rights reserved.
//

#import "DYSignatureResultCell.h"

@implementation DYSignatureResultCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    // Background Code
}

- (void)setData:(id)data delegate:(id)delegate {

    if ([data isKindOfClass:[NSDictionary class]]) {
        if ([data[@"data"] isKindOfClass:[DYSignatureResultCellModel class]]) {
            DYSignatureResultCellModel *model = data[@"data"];
            
            NSString *t = @"";
            for(int i = 0;i < model.title.length;i++) {
                NSString *content = [model.title substringWithRange:NSMakeRange(i, 1)];
                if (i == 0) {
                    t = content;
                } else {
                    t = [NSString stringWithFormat:@"%@\n%@",t,content];
                }
            }
            _titleLabel.text = t;
        }
    }
}

@end


#pragma mark - Model

@implementation DYSignatureResultCellModel

+ (DYSignatureResultCellModel *)ittemModelWithTitle:(NSString *)title {
    DYSignatureResultCellModel *model = [DYSignatureResultCellModel new];
    model.title = kSafeString(title);
    return model;
}

@end
